<?php

namespace App\Library\Logic;

use App\Models\InviteCertificationModel;

class InviteCertificationLogic extends InviteCertificationModel
{
    public static function check($userId): bool
    {
        $mainId = ShopUserLogic::valueByWhere('userId', $userId, 'userMainId');
        $mainId = is_null($mainId) ? $userId : $mainId;
        return self::existsByWhere(['status' => 1, 'userId' => $mainId]);
    }
}
